package com.quasar.hpatient.module.mine_file;

import com.quasar.hpatient.R;
import com.quasar.hpatient.dialog.CalendarDialog;
import com.quasar.hpatient.module.home_health.HealthActivity;
import com.quasar.hpatient.module.mine_case.MineCaseActivity;
import com.quasar.hpatient.module.mine_portfolio.MinePortfolioActivity;

import lib.quasar.base.frame.BaseActivity;
import lib.quasar.widget.menu.NavigationView;

/**
 * description: 我 ==> 我的档案
 * created by kalu on 2018/4/2 10:54
 */
public class MineFileActivity extends BaseActivity<MineFilePresenter> implements MineFileView {

    @Override
    public int initView() {
        return R.layout.activity_mine_file;
    }


    @Override
    public void initDataNet() {

        final NavigationView menu = findViewById(R.id.mine_archive_menu);
        menu.setOnBackChangeListener(() -> onBackPressed());

        findViewById(R.id.mine_file_daily).setOnClickListener(v -> showCalendar());
        findViewById(R.id.mine_file_medicine).setOnClickListener(v -> showCalendar());
        findViewById(R.id.mine_file_inspection).setOnClickListener(v -> showCalendar());

        findViewById(R.id.mine_file_case).setOnClickListener(v -> goNextKill(MineCaseActivity.class));
        findViewById(R.id.mine_file_history).setOnClickListener(v -> goNextKill(HealthActivity.class));
        findViewById(R.id.mine_file_record).setOnClickListener(v -> goNextKill(MinePortfolioActivity.class));
    }

    @Override
    public void showCalendar() {

        final CalendarDialog dialog = new CalendarDialog(this);
        dialog.show();
        dialog.setOnCalendarChangeListener((years, months, day, maxDay, isClick) -> {
            if (isClick) {
                toast(years + years + day + "");
            } else {
                getPresenter().schemelList(dialog, years, months, day, maxDay);
            }
        });
    }
}